import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './plugins/element.js'
import 'normalize.css'

Vue.config.productionTip = false

// mavonEditor
import mavonEditor from 'mavon-editor'
import 'mavon-editor/dist/css/index.css'
// use
Vue.use(mavonEditor)


// 权限验证
router.beforeEach((to, from, next) => {
	// 判断是否有tonken,且有效
	let tonken = true
	if(tonken)
		next()
	else
	    if (to.matched.some(record => record.meta.skip)) {
	    	console.log(to.matched[0].meta.skip)
	       next()
	    } else {
	        next("/user/login") // 确保一定要调用 next()
	    }
})

new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app')